{!
function byName(a, b) {
	if (a.name != undefined && b.name != undefined) {
		a = a.name.toLowerCase();
		b = b.name.toLowerCase();
		if (a < b) return -1;
		if (a > b) return 1;
		return 0;
	}
}

function summarize(desc) {
	if (typeof desc != "undefined")
		return desc.match(/([\w\W]+?\.)[^a-z0-9]/i)? RegExp.$1 : desc;
}

thisClass = data[0];
if (thisClass.methods) thisClass.methods.sort(byName);
if (thisClass.properties) thisClass.properties.sort(byName);
if (thisClass.events) thisClass.events.sort(byName);

function methodSignature(method) {
	var ret = "";
	for(var i = 0 ; i < method["_params"].length ; i++) {
		var param = method["_params"][i];
		if(param.isOptional) ret += "[";
		if(i != 0 ) ret += ",";
		ret += param.name;
		if(param.isOptional) ret += "]";
	}
	return ret;
}


/**
	Takes a string of object types and adds links if there exists
	any documentation files in the output for that type.
	@param typeString Like "Foo" or "Foo[] | Bar".
 */
function linkToType(typeString) {
   
	return typeString;

	var sep = /[^a-zA-Z0-9._$]+/;
	var types = typeString.split(sep);
	
	for (var i = 0; i < types.length; i++) {
		var link = linkToType.classfiles[types[i]];
		if (link) {
			var re = new RegExp('(^|[^a-zA-Z0-9._$])'+types[i]+'($|[^a-zA-Z0-9._$])');
			typeString = typeString.replace(re, "$1<a href=\""+link+"\">"+types[i]+"</a>$2", "g");
		}
	}
	
	return typeString;
}

!}

<!-- Class -->
<h2>
	<if test="thisClass.isStatic">Static </if>Class <b>{+thisClass.alias+}</b>
	<if test="thisClass.augments && thisClass.augments.length"><span class="extends"> - extends<for each="augment" in="thisClass.augments"> <a href="{+augment+}.html">{+augment+}</a></for></span><br/></if>
</h2>

<!-- Known subsclasses-->
<if test="thisClass.subclasses">
	<dl class="subclasses">
		<dt>Known Subclasses:</dt>
		<dd>
			<for each="subclass" in="thisClass.subclasses">
				<a href="{+subclass+}.html">{+subclass+}</a>
			</for>
		</dd>
	</dl>
</if>

<!--
<if test="thisClass.source"><i>Defined in <a href="{+thisClass.source+}">{+thisClass.filename+}</a></i></if>
<if test="thisClass.deprecated"><br/><b>Deprecated {+thisClass.deprecated.desc+}</b><br/></if>
-->
<!-- class description -->
<if test="thisClass.classDesc"><div class="summary description">{+thisClass.classDesc+}</div></if>

<!--
<if test="thisClass.doc">
<for each="author" in="thisClass.doc.getTag('author')">
<b>Author:</b> {+author+}<br/>
</for>
<for each="version" in="thisClass.doc.getTag('version')">
<b>Version:</b> {+version+}<br/>
</for>
</if>
<hr>
-->


<!-- ========= CONSTRUCTOR ======== -->
<if test="!thisClass.isNamespace">
<div class="section constructor details">
	<h3 id="constructor">Constructor</h3>
	<div class="content">
		<div class="detail">
			<a name="{+thisClass.name+}"> </a>
			<for each="cn" in="data">
				<strong>{+cn.alias+}</strong>
				<code>( {+methodSignature(cn)+} )</code>
				<ul>
					<if test="cn.deprecated"><br/><b>Deprecated {+cn.deprecated.desc+}</b><br/></if>
					{+cn.desc+}
				</ul>
	
				<!-- CONSTRUCTOR PARAMETERS START -->
				<if test="cn.params.length">
					<div class="description">
						<dl>
							<dt>Parameters:</dt>
							<for each="param" in="cn.params">
								<dd>
									<code>{+param.name+}<if test="param.type"><i>&nbsp;&lt;{+linkToType(param.type)+}&gt;&nbsp;</i></if></code><if test="param.isOptional"><a title="optional parameter" class="optional">optional</a></if>
									<if test="param.defaultValue != ''"><span class="optional">= {+param.defaultValue+}</span></if><if test="param.desc"> - {+param.desc+}</if> 
								</dd>
							</for>
						</dl>
					</div>		
				</if>
				<!-- CONSTRUCTOR PARAMETERS END -->
			
			</for>
		</div>
	</div>	
</div>
</if>
<!-- ========= CONSTRUCTOR END ======== -->




<!-- ============ Properties START ========= -->
<if test="thisClass.properties.length">
<a name="field_detail"> </a> 
<div class="section field details">
	<h3 id="properties">Properties</h3>
	<div class="content">
		<for each="property" in="thisClass.properties">
			<div>
				
				<h4>
					<if test="property.isPrivate">&lt;private&gt;&nbsp;</if>
					<if test="property.isStatic||!property.memberOf"><i>static</i>&nbsp;</if>
					<a name="{+property.name+}">{+property.name+}</a> 
					<code>- {+linkToType(property.type||"Object")+}</code>
					<if test="property.deprecated"><br/><b>Deprecated {+property.deprecated.desc+}</b><br/></if>
				</h4>
				
				<div class="detail">
					<div class="description">
						{+property.desc+}
						<if test="property.doc">
							<for each="since" in="property.doc.getTag('since')">
								<br><b>Since:</b> {+since+}<br/>
							</for>
						</if>
					</div>
				</div>
			</div>
			<hr>
		</for>
	</div>
</div>
</if>
<!-- ============ Properties END ========== -->




<!-- ============ METHOD DETAIL START ======= -->
<if test="thisClass.methods.length">
	<a name="method_detail"> </a> 

	<div class="section method details">
		<h3 id="methods">Methods</h3>
		<div class="content">

		<for each="method" in="thisClass.methods">
		<if test="method.memberOf == thisClass.alias">
			<div>
				<h4><a name="method_{+method.name+}">{+method.name+}</a></h4>
			
				<div class="detail">
					<code><if test="method.isPrivate">&lt;private&gt;&nbsp;</if><if test="method.isStatic||!method.memberOf"><i>static</i>&nbsp;</if><if test="method.returns.length"><for each="ret" in="method.returns"><i>&lt;{+linkToType(ret.type)+}&gt;</i>&nbsp;</for></if><b>{+method.name+}</b>({+methodSignature(method)+})</code> 
				</div>
				
				<div class="description">
					<if test="method.deprecated"><br/><b>Deprecated {+method.deprecated.desc+}</b><br/></if>
					{+method.desc+}
					<!--
					for each="since" in="method.doc.getTag('since')">
						<br><b>Since:</b> {+since+}<br/>
					/for>
				-->
				</div>
				
			<!-- METHOD PARAMETERS START -->
			<if test="method.params.length">
				<div class="description">
				<b>Parameters:</b><for each="param" in="method.params">
					<ul>
						<code>{+param.name+}<if test="param.type">&nbsp;<i>&lt;{+linkToType(param.type)+}&gt;</i>&nbsp;</if></code><if test="param.isOptional"><a title="optional parameter" class="optional">optional</a></if>
						<if test="param.defaultValue != ''"><span class="optional">= {+param.defaultValue+}</span></if><if test="param.desc"> - {+param.desc+}</if> 
					</ul>
					</for>
				</div>
				</if>
				<!-- METHOD PARAMETERS END -->
				<!-- ADDITIONAL ATTRIBUTES START -->
				<if test="method.returns.length">
					<div class="description">
					<b>Returns:</b><for each="ret" in="method.returns">
						<ul>
							<code><if test="ret.type"><i>&lt;{+linkToType(ret.type)+}&gt;</i>&nbsp;</if></code>{+ret.desc+} 
						</ul>
					</for>
					</div>
				</if>
				
					<if test="method.exceptions.length">
						<div class="description">
						<b>Throws:</b>
						<for each="ex" in="method.exceptions">
							<ul>
								<code>{+linkToType(ex.type)+}</code> {+ex.desc+} 
							</ul>
						</for>
						</div>
					</if>
						<!-- ADDITIONAL ATTRIBUTES  END -->
						<hr>
						</div>
					</if>
					</for>

				</div>
			</div>

</if>
<!-- ============ METHOD DETAIL END ========== -->




<!-- ========== INHERITED METHODS SUMMARY =========== -->
<if test="thisClass.inherited">

	
	<for each="className" in="keys(thisClass.inherited)">
		<div class="section field inheritance">
			<h4>Methods inherited from class <a href="{+className+}.html">{+className+}</a>:</h4>
			<div class="content">
				<code>
					<for each="method" in="thisClass.inherited[className]">
						<a href="{+method.memberOf+}.html#{+method.name+}">{+method.name+}</a>,
					</for>		
				</code>
			</div>
		</div>
	</for>
	<br/>
	
</if>
<br/>

<!-- ========== END INHERITED METHODS SUMMARY =========== -->



<!-- ============ EVENT DETAIL START ======= -->
<if test="thisClass.events">
<if test="thisClass.events.length">
<a name="method_detail"> </a> 

<!--
<table border="1" cellpadding="3" cellspacing="0" width="100%">
	<tr bgcolor="#CCCCFF" class="TableHeadingColor">
		<td colspan=1>
			<font size="+2"> <b>Event Detail</b></font> 
		</td>
	</tr>
</table>-->

<div class="section method details">
	<h3 id="events">Events</h3>
	<div class="content">


<for each="event" in="thisClass.events">
	<a name="{+event.name+}"> </a> <h4>{+event.name+}</h4>
		<code><if test="event.isPrivate">&lt;private&gt;&nbsp;</if><if test="event.isStatic||!event.memberOf"><i>static</i>&nbsp;</if><if test="event.returns.length"><for each="ret" in="event.returns">{+linkToType(ret.type)+}&nbsp;</for></if><b>{+event.name+}</b>({+methodSignature(event)+})</code> 
	<div class="description">
		<if test="event.deprecated"><br/><b>Deprecated {+event.deprecated.desc+}</b><br/></if>
		{+event.desc+}
		<for each="since" in="event.doc.getTag('since')">
			<br><b>Since:</b> {+since+}<br/>
		</for>
	</div>
	<!-- EVENT PARAMETERS START -->
	<if test="event.params.length">
		<div class="description">
			<b>Parameters:</b><for each="param" in="event.params">
				<ul>
					<code>{+param.name+}<if test="param.type">&nbsp;<i>&lt;{+linkToType(param.type)+}&gt;</i>&nbsp;</if></code><if test="param.isOptional"><a title="optional parameter" class="optional">optional</a></if>
					<if test="param.defaultValue != ''"><span class="optional">= {+param.defaultValue+}</span></if><if test="param.desc"> - {+param.desc+}</if> 
				</ul>
			</for>
	</div>
	</if>
	<!-- EVENT PARAMETERS END -->
	<!-- ADDITIONAL ATTRIBUTES START -->
	<if test="event.returns.length">
		<div class="description">
		<b>Returns:</b>
		<for each="ret" in="event.returns">
		<ul>
			<code><if test="ret.type"><i>&lt;{+linkToType(ret.type)+}&gt;</i>&nbsp;</if></code>{+ret.desc+} 
		</ul>
		</for>
	</div>
	</if>
	
	<if test="event.exceptions.length">
	<div class="description">
		<b>Throws:</b>
		<for each="ex" in="event.exceptions">
		<ul>
			<code>{+linkToType(ex.type)+}</code> {+ex.desc+} 
		</ul>
		</for>
	</div>
	</if>
	<!-- ADDITIONAL ATTRIBUTES  END -->
	<hr>
</for>

	</div>
	</div>

</if>
</if>

